let initData = {
    item: JSON.parse(localStorage.getItem('item')) || []
}

let DetailReducer = (state = initData, {type, payload}) => {

    switch(type) {
        case 'DETAIL_BTN':

            localStorage.setItem('item', JSON.stringify(payload))

            return {
                ...state,
                item: payload
            }

        default:
            return {
                ...state
            }
    }

}

export default DetailReducer